package yicr.untils.gis.mif.domain;




import yicr.untils.gis.domain.NslGpsPoint;

import java.util.ArrayList;
import java.util.List;

/**
 * <h3>Title:</h3>
 * <p>
 *  解析的时候分为5个部分
 *  4个StringLine: Region,Pen,Bursh,Center
 *  1个List<NslGpsPoint>[],数组大小可能会超过1，因为有大圆套小圆的现象
 * <h3>Description</h3>
 * <p>
 * region 示例
 * Region  2
 *   9
 * 113.93286 32.996182
 * 113.937359 32.996303
 * 113.94323 32.997461
 * 113.944283 32.997669
 * 113.944262 32.990368
 * 113.953359 32.990249
 * 113.955947 32.981325
 * 113.940954 32.972684
 * 113.93286 32.996182
 *   4
 * 113.970564 32.96606
 * 113.970812 32.966087
 * 113.970685 32.966053
 * 113.970564 32.96606
 *     Pen (1,2,65535)
 *     Brush (1,0,16777215)
 *     Center 113.947006 32.982052
 * <h3>Author</h3>
 * <p>
 * Lin Shao
 * <h3>Update Time</h3>
 * <p>2021-05-21 15:58
 *
 * @author Lin Shao
 * @version 1.0
 */
public class MifRegion {
    //实际不起作用
    public static String gpsCenterLongitude="111.111111";
    public static String gpsCenterLatitude="34.111111";

    private int regionCount=0;
    private List<NslGpsPoint>[] polygonListArray =null;
    //private String regionLine=null;

    //    Pen (1,2,11579568)
    //注意空格 pen前4后1空格,行尾一个空格
    private String penString=null;

    //    Brush (2,13689087,5291995)
    //注意空格 Brush前4后1空格
    private String brushString=null;

    //    Center 113.929083 32.736789
    //注意空格 Center前4后1空格
    private String centerString=null;

    public MifRegion(int regionCount) {
        this.regionCount = polygonListArray.length;
        this.polygonListArray = new List[regionCount];
        for (int i = 0; i < polygonListArray.length; i++) {
            this.polygonListArray[i]=new ArrayList<>();
        }

        setBrushString("    Brush (2,16777215,16777215)");
        setPenString("    Pen (1,2,0) ");
        setCenterString("    Center "+gpsCenterLongitude+" "+gpsCenterLatitude);
    }

    public MifRegion(List<NslGpsPoint>[] polygonListArray) {
        this.regionCount = polygonListArray.length;
        this.polygonListArray = new List[regionCount];
        for (int i = 0; i < polygonListArray.length; i++) {
            this.polygonListArray[i]=polygonListArray[i];
        }

        setBrushString("    Brush (2,16777215,16777215)");
        setPenString("    Pen (1,2,0) ");
        setCenterString("    Center "+gpsCenterLongitude+" "+gpsCenterLatitude);
    }

    public int getRegionCount() {
        return regionCount;
    }

    public void setRegionCount(int regionCount) {
        this.regionCount = regionCount;
    }

    public List<NslGpsPoint>[] getPolygonListArray() {
        return polygonListArray;
    }

    public void setPolygonListArray(List<NslGpsPoint>[] polygonListArray) {
        this.polygonListArray = polygonListArray;
    }

    public String getPenString() {
        return penString;
    }

    public void setPenString(String penString) {
        this.penString = penString;
    }

    public String getBrushString() {
        return brushString;
    }

    public void setBrushString(String brushString) {
        this.brushString = brushString;
    }

    public String getCenterString() {
        return centerString;
    }

    public void setCenterString(String centerString) {
        this.centerString = centerString;
    }

   /* public String getRegionLine() {
        return regionLine;
    }

    public void setRegionLine(String regionLine) {
        this.regionLine = regionLine;
    }*/
}
